package com.joven.interface1.controller;

import com.joven.core.constant.ResultInfo;
import com.joven.core.model.User;
import com.joven.interface1.localService.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author joven_wong
 * 2021/6/4 16:59
 */
@RestController
@RequestMapping("/joven")
public class JovenController {


    private  TestService testService;

    @Autowired
    public void setTestService(TestService testService) {
        this.testService = testService;
    }

    @GetMapping("/getOne")
    public ResultInfo<User> getUser(Long id){
        return ResultInfo.success(testService.getOneById(id));
    }
}
